package com.chinalife.controller

import org.springframework.beans.factory.annotation.Autowired
import org.springframework.stereotype.Controller
import org.springframework.ui.Model
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.RequestMapping

import com.chinalife.service.UserService

@Controller
@RequestMapping("user")
class UserController {

	@Autowired
	UserService service;
	
	@GetMapping("findList")
	def findList(Integer page, Integer size, Model model){
//		service.findList(page, size).each{
//			it.each{key, value->
//				println "${key}: ${value}"
//			}
//		}
		model.addAttribute("list", service.findList(0, 20))
		"index"
	}
}
